package com.lishem.codec.decode;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ReplayingDecoder;

import java.util.List;

public class IntegerHeaderFrameDecoder extends ReplayingDecoder<Void> {

    protected void decode(ChannelHandlerContext ctx,ByteBuf buf, List<Object> out) throws Exception {
        out.add(buf.readBytes(buf.readInt()));
    }
}